import React,{ReactElement,FC} from 'react';
import {
    Navigate
} from "react-router-dom";
import {useSelectorAuth} from "@/store/slices/auth";
type TProps = {
    children:ReactElement
}
const Index:FC<TProps> = (props)=>{
    const {token} = useSelectorAuth();
    return token?props.children:<Navigate to={"/login"}></Navigate>;
}

export default Index;